package com.syxp.pda.core.command;

import org.hibernate.Criteria;
import org.hibernate.criterion.Example;

public class ExampleCommand implements CriteriaCommand{

	private Object pojoExample ;
	
	public Object getPojoExample() {
		return pojoExample;
	}

	public void setPojoExample(Object pojoExample) {
		this.pojoExample = pojoExample;
	}

	public ExampleCommand(Object pojoExample){
		this.pojoExample = pojoExample ;
	}
	
	@Override
	public Criteria execute(Criteria criteria) {
		if(criteria!=null){
			Example example = Example.create(pojoExample).excludeZeroes().enableLike() ;
			criteria.add(example) ;
		}
		return criteria;
	}

	
}
